package com.situ.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
import com.situ.service.PyBalancedetailService;
import com.situ.entity.PyBalancedetail;
import java.util.*;
/**
 * PyBalancedetail的路由接口服务
 * 
 * @author 胡文
 *
 */
@Controller
public class PyBalancedetailController {

	/** PyBalancedetailService服务 */
	@Autowired
	private PyBalancedetailService pyBalancedetailService;
	
	/**
	 * 查询所有PyBalancedetail数据的方法
	 * @param value
	 * @return
	 */
	@RequestMapping(value = "queryPyBalancedetail", produces = {"application/json;charset=UTF-8"})
	public String find(PyBalancedetail value,Map map) {
		 List<PyBalancedetail> list= pyBalancedetailService.find(value);
         map.put("items",list);
         return "页面名称自己改";
	}
	
	/**
	 * 通过id查询PyBalancedetail数据的方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "queryPyBalancedetailById/{id}", produces = {"application/json;charset=UTF-8"})
	public String findOne(@PathVariable(name="id") Object id,Map map) {
        PyBalancedetail obj=  pyBalancedetailService.findOne(id);
        map.put("PyBalancedetail",obj);
        return "页面名称自己改";
	}
	
	/**
	 * 插入PyBalancedetail属性不为空的数据方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "savePyBalancedetail", produces = {"application/json;charset=UTF-8"})
	public String save(PyBalancedetail value) {
		  pyBalancedetailService.saveNotNull(value);
        return "redirect:/queryPyBalancedetail";
	}
	
	/**
	 * 更新PyBalancedetail属性不为空的数据方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "updatePyBalancedetail", produces = {"application/json;charset=UTF-8"})
	public String update(PyBalancedetail value) {
		  pyBalancedetailService.updateNotNullById(value);
          return "redirect:/queryPyBalancedetail";
	}
	
	/**
	 * 通过id删除PyBalancedetail数据方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "delPyBalancedetailById/{id}", produces = {"application/json;charset=UTF-8"})
	public String delete(@PathVariable(name="id") Object id) {
		  pyBalancedetailService.deleteById(id);
          return "redirect:/queryPyBalancedetail";
	}
}
